package com.sdk.pay.transfer.api;


import com.sdk.pay.transfer.api.params.Params;
import com.sdk.pay.transfer.listener.CallBack;

import org.json.JSONException;

import java.io.IOException;

/**
 * Created by Administrator on 2017/5/3.
 */

public abstract class APISHelper {
    private static final BaseAPIS sBaseAPIS = BaseAPIS.getInstance();

    protected abstract Params initParams() throws JSONException;

    protected void get(String tag, String url, CallBack callback) throws JSONException {
        sBaseAPIS.get(tag, url, initParams(), callback);
    }

    protected void post(String tag, String url, CallBack callback) throws JSONException {
        sBaseAPIS.post(tag, url, initParams(), callback);
    }
    protected void postNoEncryption(String tag, String url, CallBack callback) throws JSONException {
        sBaseAPIS.postNoEncryption(tag, url, initParams(), callback);
    }

    protected void syncPost(String tag, String url, CallBack callback) throws JSONException, IOException {
        sBaseAPIS.syncPost(tag,url,initParams(),callback);
    }
}
